package com.swq.java.code.chapter09.code02;

import com.swq.java.code.chapter09.code01.Car;

/**
 * @author xi.yang
 * @create 2019-05-15 19:12
 **/
public class Worker {
    private Car car;
    public static int IN_TIME = 1;
    public static int LATE = 2;

    public Worker(Car car) {
        this.car = car;
    }

    public int gotoWork() {
        if (Car.OK == car.run()) {
            return IN_TIME;
        } else {
            walk();
            return LATE;
        }
    }

    private void walk() {

    }
}
